<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/init.jsp"%>
<script src="<c:url value='/resources/js/jquery-1.7.2.min.js"'/>"></script>
<link href="<c:url value='/admin/css/custom.css'/>" rel="stylesheet" type="text/css" />
<link href="<c:url value='/admin/css/style.css'/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<c:url value='/resources/js/mask.js'/>"></script>
<div class="EpmsSubTitle"><p><b>股票操作</b></p></div>
<table width="100%" border="10" cellspacing="10" cellpadding="0" class="EpmsTable">
    <tr>
	    <td class=EpmsTdTitle>重要提示：</td>
	    <td class=EpmsTdNoColor>请在复盘后，立即执行复盘买入操作。</td>
    </tr>
	<tr style="padding:20 0 20 20">
	    <td class=EpmsTdTitle >停复盘操作：</td>
	    <td class=EpmsTdNoColor >
	    	<c:if test="${item.code == '1' }">
	    		<input type="button" value="停盘" id="stopStock"/>
	    	</c:if>
	    	<c:if test="${item.code == '0' }">
	    		<input type="button" value="复盘" id="resumeStock"/>
	    	</c:if>
	    </td>
	</tr>
	<tr>
	    <td class=EpmsTdTitle >复盘买入：</td>
	    <td class=EpmsTdNoColor >
	    	<input type="button" value="复盘买入" id="buyStock"/>
	    </td>
	</tr>
	
</table>
<script>
	//stockSplitForm
	$("#stopStock").click(function(){
		if(window.confirm("确认进行此操作吗？")){
			$(document).mask("系统处理中，请稍后......");
			$.get("stock.action?cmd=stop",function(data,status){
				 if($.trim(data) == '1'){
			    	alert("操作成功！");
			    	window.location= "stock.action";
			    }else{
			    	alert("操作失败，请重试！");
			    	window.location= "stock.action";
			    }
			});
		}
	});
	
	$("#resumeStock").click(function(){
		if(window.confirm("确认进行此操作吗？")){
			$(document).mask("系统处理中，请稍后......");
			$.get("stock.action?cmd=resume",function(data,status){
			    if($.trim(data) == '1'){
			    	alert("操作成功！");
			    	window.location= "stock.action";
			    }else{
			    	alert("操作失败，请重试！");
			    	window.location= "stock.action";
			    }
			});
		}
	});
	
	$("#buyStock").click(function(){
		if(window.confirm("确认进行此操作吗？")){
			$(document).mask("此操作过程时间稍长，请稍后......");
			$.get("stock.action?cmd=buy",function(data,status){
				 if($.trim(data) == '1'){
			    	alert("操作成功！");
			    	window.location= "stock.action";
			    }else{
			    	alert("操作失败，请重试！");
			    	window.location= "stock.action";
			    }
			});
		}
	});
</script>